package com.ruoyi.web.filter;

import com.ruoyi.web.filter.MyInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

public class SpringMvcSupport extends WebMvcConfigurationSupport {

    @Autowired
    private MyInterceptor myInterceptor;
    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        //配置拦截器
        registry.addInterceptor(myInterceptor)
                .addPathPatterns("/**") // 需要拦截的路径（/** 拦截所有路径）
                .excludePathPatterns("/employee/login","/employee/logout","/backend/**","/front/**");//放行静态资源和登陆资源;
    }
}
